from selenium import webdriver
from selenium.webdriver.common.by import By
import time
d = webdriver.Chrome()
d.get('https://www.baidu.com')
d.maximize_window()
time.sleep(2)

a = d.find_element(By.CSS_SELECTOR, '[class="soutu-btn"]')
a.click()

# 只有上传的按钮是input标签才可以上传
b = d.find_element(By.CSS_SELECTOR, '[class="upload-pic"]') # 先定位到上传
b.send_keys(r'C:\Users\12964\Pictures\Camera Roll\胡桃.jpeg') # 直接send_keys(r'文件路径)
time.sleep(10)
d.quit()